<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_personal.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.tb_commpara.*" %>
<%@page import="com.lmpop.trade.ts_custclass.*" %>
<%@page import="com.lmpop.trade.ts_area.*" %>
<%@page import="com.lmpop.trade.ti_custlevel.*" %>
<html>
  <head>
    
    <title>会员管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_areaInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Tb_commparaInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type='text/javascript' src='js_personal.js'></script>	
	<script type='text/javascript' src='js_commen.js'></script>
</head>

<body>

  <% 
  	String cust_id="";
	Ts_areaInfo areaBean = new Ts_areaInfo();
  	if(request.getParameter("cust_id")!=null) cust_id = request.getParameter("cust_id");


	Ti_custlevelInfo custLevelInfo = new Ti_custlevelInfo();
	List custLevel_list = custLevelInfo.getListByPk(cust_id);
	Hashtable custLevel_map = new Hashtable();	
	if(custLevel_list!=null && custLevel_list.size()>0) custLevel_map = (Hashtable)custLevel_list.get(0);
	
	String cust_start_date = "";
	if(custLevel_map.get("cust_start_date")!=null){
	cust_start_date = custLevel_map.get("cust_start_date").toString();
	if(cust_start_date.length()>10)cust_start_date=cust_start_date.substring(0,10);
	}
	String cust_end_date = "";
	if(custLevel_map.get("cust_end_date")!=null){
	cust_end_date = custLevel_map.get("cust_end_date").toString();
	if(cust_end_date.length()>10)cust_end_date=cust_end_date.substring(0,10);
	}	
	String user_class = "";
	if(custLevel_map.get("cust_class")!=null){
	user_class = custLevel_map.get("cust_class").toString();
	}		
	Map custclassinfoMap = new Hashtable();
	custclassinfoMap.put("class_type","0");	
	Ts_custclassInfo custclassinfo = new Ts_custclassInfo();
	String custclass_select =  custclassinfo.getSelectString(custclassinfoMap,user_class);
	
	Tb_commparaInfo tb_commparaInfo=new Tb_commparaInfo();
	String _income = tb_commparaInfo.getSelectItem("20","");	
  	Ti_personalInfo ti_personalInfo = new Ti_personalInfo();
  	List list = ti_personalInfo.getListByPk(cust_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String nike_name="",phone="",email="",cellphone="",fax="",qq="",msn="",post_code="",address="",sex="",birth="",area_attr="",marry="",blood_type="",career="",job="",hobby="",income="",in_date="",pub_user_id="",remark="";
  	String state_code = "",cust_name="";

	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
	if(map.get("cust_name")!=null) cust_name = map.get("cust_name").toString();
	if(map.get("nike_name")!=null) nike_name = map.get("nike_name").toString();
  	if(map.get("phone")!=null) phone = map.get("phone").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
  	if(map.get("fax")!=null) fax = map.get("fax").toString();
  	if(map.get("qq")!=null) qq = map.get("qq").toString();
  	if(map.get("msn")!=null) msn = map.get("msn").toString();
  	if(map.get("post_code")!=null) post_code = map.get("post_code").toString();
  	if(map.get("address")!=null) address = map.get("address").toString();
  	if(map.get("sex")!=null) sex = map.get("sex").toString();
  	if(map.get("birth")!=null) birth = map.get("birth").toString();
  	if(map.get("area_attr")!=null) area_attr = map.get("area_attr").toString();
  	if(map.get("marry")!=null) marry = map.get("marry").toString();
  	if(map.get("blood_type")!=null) blood_type = map.get("blood_type").toString();
  	if(map.get("career")!=null) career = map.get("career").toString();
  	if(map.get("job")!=null) job = map.get("job").toString();
  	if(map.get("hobby")!=null) hobby = map.get("hobby").toString();
  	if(map.get("income")!=null) income = map.get("income").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("pub_user_id")!=null) pub_user_id = map.get("pub_user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
	
	
		String areaAttr = "",classAttr = "";
			
		if (map.get("area_attr") != null) {
		area_attr = map.get("area_attr").toString();
		String areaArr[] = area_attr.split("\\|");
		for( int k = 0; k < areaArr.length; k++ ){
			areaAttr = areaAttr + " &nbsp; " + areaBean.getAreaNameById( areaArr[k]);
		}
	}	
  %>
	
	<h1>修改个人会员信息</h1>
	
	<!--
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>-----------------</h4>
		  <span>1----------------。</span><br/>
		  <span>2----------------。</span>
		  </td>
        </tr>
      </table>
      <br/>
	  -->
	
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">

			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">个人基本信息</span>			</td>
		    </tr>

		<tr>
			<td align="right" width="10%">
				会员名称
			</td>
			<td width="30%" colspan="3"><%=cust_name%></td>

		</tr>
		
		<tr>
			<td align="right" width="10%">
				会员昵称
			</td>
			<td width="30%"><%=nike_name%></td>

			<td align="right" width="10%">
				会员级别
			</td>
			<td>
			<select value="" name="user_class" style="width:145px" id="user_class" disabled>
					<%=custclass_select%>
			</select>
		</tr>
			<tr>
				<td align="right" width="10%">
					服务开始时间:
				</td>
				<td  >
				
				<%=cust_start_date%>
				
				</td>

				<td align="right" width="10%">
					服务结束时间:
				</td>
				
				<td >
					<%=cust_end_date%>
				</td>
			</tr>

			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">个人详细信息</span>			</td>
		    </tr>
			
		<tr>
			<td align="right" width="10%">
				固话:
			</td>
			<td width="30%"><%=phone%></td>
			<td align="right" width="10%">
				手机:
			</td>
			<td><%=cellphone%></td>			
		</tr>
		
		<tr>
			<td align="right" width="10%">
				Email:
			</td>
			<td><%=email%></td>
			<td align="right" width="10%">
				传真:
			</td>
			<td><%=fax%></td>
		</tr>

		
		<tr>
			<td align="right" width="10%">
				QQ:
			</td>
			<td><%=qq%></td>
			<td align="right" width="10%">
				MSN:
			</td>
			<td><%=msn%></td>			
		</tr>
		<tr>
	<td align="right" width="10%">
				邮政编码:
			</td>
			<td><%=post_code%></td>

			<td align="right" width="10%">
				是否已婚:
			</td>
			<td>	
			<input name="marry" id="marry" disabled value="0" <%if(marry.equals("0")){%> checked<%}%> type="radio" />已婚
				<input name="marry" id="marry" disabled value="1"<%if(marry.equals("1")){%> checked<%}%> type="radio" />未婚</td>			
		</tr>
		<tr>
		
			<td align="right" width="10%">
				所在地区
			</td>
			<td width="30%">
				<div id="org1">
					<font color="#CECECE"><%=areaAttr%></font>
					<!-- <input type="button" name="buttons" value="修改地区" class="buttoncss" onclick="ChangeOrg()" /> -->
				</div>
				<div style="display:none;" id="org2">
					<select name="province" id="province" onclick="setCitys(this.value)">
					  <option value="">省份</option> 
					</select>
					<select name="eparchy_code" id="eparchy_code" onclick="setAreas(this.value)">
					  <option value="">地级市</option> 
					 </select>
					<select name="city_code" id="city_code" style="display:inline" >
					 <option value="">市、县级市、县</option> 
					</select>
				</div>
					<input type="hidden" name="area_attr_bak" id="area_attr_bak" value="<%=area_attr%>" />
					<input type="hidden" name="area_attr" id="area_attr" value="" />
				</td>


			<td align="right" width="10%">
				地址:
			</td>
			<td><%=address%></td>
						
		</tr>
		
		<tr>
			<td align="right" width="10%">
				性别:
			</td>
			<td>
			<input name="sex" id="sex" disabled value="0" <%if(sex.equals("0")){%> checked<%}%> type="radio" />男
			<input name="sex" id="sex" disabled value="1" <%if(sex.equals("1")){%> checked<%}%>  type="radio" />女</td>
			<td align="right" width="10%">
				出生日期:
			</td>
			<td><%=birth%></td>			
		</tr>
		

		<tr>
			<td align="right" width="10%">
				血型:
			</td>
			<td>
			<select name="blood_type" id="blood_type" disabled>
			<option>请选择</option>
			<option value="0" <%if(blood_type.equals("0")){%>selected<%}%>>O型</option>
			<option value="1" <%if(blood_type.equals("1")){%>selected<%}%>>A型</option>
			<option value="2" <%if(blood_type.equals("2")){%>selected<%}%>>B型</option>
			<option value="3" <%if(blood_type.equals("3")){%>selected<%}%>>AB型</option>
			
			</select></td>
			<td align="right" width="10%">
				教育程度:
			</td>
			<td><%=career%></td>			
		</tr>
		

		
		<tr>
			<td align="right" width="10%">
				工作:
			</td>
			<td><%=job%></td>
		<td align="right" width="10%">
				爱好:
			</td>
			<td><%=hobby%></td>			
		</tr>
		

		
		<tr>
			<td align="right" width="10%">
				收入:
			</td>
			<td colspan="3"><select name="income" id="income" disabled><%=_income%></select></td>

		
		</tr>
<tr>
		<td  colspan="4">
	   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">审核信息</span>			
		</td>
	</tr>
	
	<tr>
		<td align="right" width="10%">
			是否通过			
		</td>
		<td colspan="3">    
			<input type="radio" name="up_operating" id="state_code1" onclick="change(0)" checked value="c" />审核通过
			<input type="radio" name="up_operating" id="state_code2" onclick="change(1)" value="b" />审核不通过
		</td>
	</tr>
	
	<tr>
		<td align="right" width="10%" >
			<div id="reson1" style="display:none">不通过理由</div>
		</td>
		<td colspan="3">    
			<div id="reson2" style="display:none"><textarea name="remark" cols="100" rows="10"></textarea></div>
		</td>
	</tr>
	
	
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="8342" />
				<input type="hidden" name="pkid" id="pkid" value="<%=cust_id %>" />
				<input type="hidden" name="cust_type" value="1" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="subForm();"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
